package org.example.core.Service.impl;

import org.example.core.Service.wsNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;

@Service
public class wsNoticeServiceImpl implements wsNoticeService {
    public static final String COMFYUI_QUEUE_TOPIC = "/topic/messages";
    @Autowired
    private SimpMessagingTemplate template;
    @Override
    public void sendToUser(String ClientId, String Message) {
        template.convertAndSendToUser(ClientId,COMFYUI_QUEUE_TOPIC,Message);
    }

    @Override
    public void sendToAll(String Message) {
        template.convertAndSend(COMFYUI_QUEUE_TOPIC,Message);
    }
}
